<%@page pageEncoding = "utf-8" contentType = "text/html;charset=utf-8"%>

<%@taglib prefix = "c" uri = "http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix = "fmt" uri = "http://java.sun.com/jsp/jstl/fmt"%>
<%@taglib prefix = "fn" uri = "http://java.sun.com/jsp/jstl/functions"%>

<script type="text/javascript">
window.onload = function () {
  startdate  = new Epoch('epoch_popup','popup',document.getElementById('startdate'));
  enddate  = new Epoch('epoch_popup','popup',document.getElementById('enddate'));
};
</script>

<h2>Отчет</h2>

<div class = "messages"><jsp:include page = "/messages.jsp"/></div>

<form action = "chiefui" method = "post" name = "reportForm">
<table class = "form">                                 
      <tr>
         <td class = "label">C</td>
         <td><input class="date" id="startdate" type="text" name="startDate" value='<fmt:formatDate value="${startDate}" pattern="dd.MM.yyyy"/>'/></td>    
         <td class = "label">по</td>
         <td><input class="date" id="enddate" type="text" name="endDate" value='<fmt:formatDate value="${endDate}" pattern="dd.MM.yyyy"/>'/></td>
      </tr>
</table>

<input name = "_action" type = "hidden" value = "processMainReport">

<p><input type="submit" value="Сформировать отчет"></p>
</form>


<table class = "form" style="width: 100%">                                 
      <tr style="border-bottom: 1px #f1f1f1 solid;">
        <th>&nbsp;</th>
        <th>Новых задач</th>
        <th>Завершено задач</th>
        <th>Новых заявок</th>
        <th>Завершено заявок</th>
      </tr>
      
      <c:forEach var = "item" items = "${reportList}">
      <tr style="border-bottom: 1px #f1f1f1 solid;">
         <th><c:out value="${item.employee.formName}"/></th>
         <td>${item.newTasks}</td>
         <td>${item.finishedTasks}</td>
         <td>${item.newRequests}</td>
         <td>${item.finishedRequests}</td>
      </tr>
      </c:forEach>      
</table>